import {Star, StarSign} from "../../types.ts";
import SelectItem from "./SelectItem.tsx";

interface SelectProps {
    starSign: StarSign[],
    open: boolean,
    setOpen: (value: boolean) => void
    onChangSelect: (star: Star) => void
}

function Select({starSign, open, setOpen,onChangSelect}: SelectProps) {
    return (
        <div style={{
            display: open ? 'flex' : "none"
        }} className="select-container">
            {
                starSign.map(star => <SelectItem onChangSelect={onChangSelect} setOpen={setOpen} key={star.key} star={star}/>)
            }
        </div>
    )
}

export default Select;